From f8e7b44d2816108ace9e262f5161a98079a4ca7b Mon Sep 17 00:00:00 2001 From: scorpion81 Date: Mon, 22 May 2023 16:48:55 +0200 Subject: Limit the device access memory to 4 GB Hardly limiting the device access memory to 4 GB for integrated vulkan devices here. This works for the Steam Deck in order not to go above 4 GB VRAM usage any more (above this value the likelihood to crash when the RAM exceeds 12 GB as well raises). But there will be perhaps a detection mechanism necessary for detecting the real memory limit for integrated vulkan devices. Those likely might have small limits anyway, but what about integrated GPUs on machines with > 16 GB RAM, aka larger amounts ? --- src/video_core/vulkan_common/vulkan_device.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index f6e6f2736..c0b2b3e17 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp @@ -1034,7 +1034,7 @@ void Device::CollectPhysicalMemoryInfo() { } const s64 available_memory = static_cast(device_access_memory - device_initial_usage); device_access_memory = static_cast(std::max( - std::min(available_memory - 8_GiB, 4_GiB), static_cast(local_memory))); + std::min(available_memory - 8_GiB, 4_GiB), std::min(local_memory, 4_GiB))); } void Device::CollectToolingInfo() { -- cgit v1.2.3